package qgs.zisu.javaconcurrency.javaconcurrency.chapter5_join;

import java.util.Optional;

/**
 * @Author: 蔡翔
 * @Date: 2019/9/23 15:20
 * @Version 1.0
 */
public class ThreadJoin2 {
    public static void main(String[] args) {
        Thread t1 = new Thread(()->{
            try {
                System.out.println("t1 is running");
                Thread.sleep(10_000);
                System.out.println("t1 is done");
            }catch (Exception e){
                e.printStackTrace();
            }
        });
        t1.start();
        Optional.of("All of tasks finish done.").ifPresent(System.out::print);


    }
}
